<@_placeMetadata path=path><#assign a=object/></@_placeMetadata>
<style>
.CodeMirror{height:100%;font-size:14px;}
</style>
<script>
function refreshcmsTemplatePlace(){
	$('textarea[name=content]',navTab.getCurrentPanel()).val(cmsTemplatePlaceEditor.getValue());
}
</script>
<h2 class="contentTitle">
	<a href="cmsTemplate/placeLookup.html" target="dialog" mask="true">推荐位</a>
 	<a href="cmsTemplate/ftlLookup.html" target="dialog" mask="true">模板片段</a>
	<a href="cmsTemplate/metadata.html?path=${'/ftl/'?url}" target="navTab" rel="cmsTemplate/metadata">创建模板片段</a>
	<#if (a.allowContribute)?has_content&&a.allowContribute>
		<a href="cmsTemplate/placeForm.html?path=${path?html?url}" target="navTab" rel="cmsTemplate/placeForm">前台表单模板</a>
	</#if>
	<#if site.useSsi>
		<a href="cmsTemplate/publishPlace.do?path=${(path?url!)}" target="ajaxTodo">发布</a>
	</#if>
	<a href="cmsTemplate/deletePlace.do?path=${path?html?url}&navTabId=cmsTemplate/placeList" title="确定要删除该模板吗?" target="ajaxTodo">删除推荐位</a>
 </h2>
<div class="pageContent">
	<form method="post" action="cmsTemplate/save.do?navTabId=cmsTemplate/placeList" class="pageForm required-validate" onsubmit="refreshcmsTemplatePlace();return validateCallback(this, navTabAjaxDone);">
		<div class="pageFormContent" layoutH="98" style="background:#ffffff;">
	   		<div>
				<input name="path" type="hidden" value="${'/include'+path?html}"/>
				<textarea name="content" id="cmsTemplatePlaceEditor"><@_templateContent path='/include'+path>${(object?html)!}</@_templateContent></textarea>
				<script>
					var cmsTemplatePlaceEditor = CodeMirror.fromTextArea(document.getElementById('cmsTemplatePlaceEditor'), {
				        mode: "freemarkermixed",
				        lineNumbers: true,
				        tabSize        : 4,
				        indentUnit     : 4,
				        lineWrapping   : true,
				        indentWithTabs : true,
				        extraKeys: { "Ctrl-Space": "autocomplete" }
					});
				</script>
			</div>
		</div>
		<div class="formBar">
			<ul>
				<li><a class="button" href="cmsTemplate/placeMetadata.html?path=${(path?url)!}" target="ajax" rel="cmsTemplatePlace"><span>推荐位元数据</span></a></li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
</div>